import React from 'react';
import ReactDOM from 'react-dom';
class Hello extends React.Component { 
  state = {
    num: 0
  }

  change = (e) => {
    // console.log(e)
    this.setState({num: e.target.value})
  }

  render() { 
    return (<div>
        <input type="text" value={this.state.num} onChange={this.change}/> <div>{this.state.num}</div></div>)
  } 
} 
ReactDOM.render(
<div>
  <Hello />
</div>, document.getElementById('root')) 